package com.springboot.springboot_demo02.service.Impl;

import com.springboot.springboot_demo02.dao.ArticleDao;
import com.springboot.springboot_demo02.pojo.Article;
import com.springboot.springboot_demo02.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ArticleServiceImpl implements ArticleService {
    @Autowired
    private   ArticleDao articleDao;
    @Override
    public List<Article> findAll() {

        List<Article> list= articleDao.findAll();

        return list;
    }

    @Override
    public List<Article> findById(Integer id) {
        List<Article> list= articleDao.findById(id);
        return list;
    }

    @Override
    public int update(Article article) {
        int row = articleDao.update(article);
        return row;
    }

    @Override
    public int delete(Integer id) {
        int row = articleDao.delete(id);
        return row;
    }

    @Override
    public int save(Article article) {
        int row = articleDao.save(article);
        return row;
    }
}
